package com.iqiao.common.exception;

import com.iqiao.common.web.result.JsonResult;
import com.iqiao.common.web.result.ReturnCode;

/**
 * Created by flt on 2017/11/13.
 */
public class ResetException extends RuntimeException {

    protected int code;
    protected JsonResult jsonResult;

    public ResetException(){
        super("服务器错误！");
        this.code = ReturnCode.ERROR;
        this.jsonResult = new JsonResult(this.code, this.getMessage());
    }

    public ResetException(String message){
        super(message);
        this.code = ReturnCode.ERROR;
        this.jsonResult = new JsonResult(this.code, this.getMessage());
    }

    public ResetException(int code, String message) {
        super(message);
        this.code = code;
        this.jsonResult = new JsonResult(code, message);
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public JsonResult getJsonResult() {
        return jsonResult;
    }

    public void setJsonResult(JsonResult jsonResult) {
        this.jsonResult = jsonResult;
    }
}
